#!/bin/sh

template() {
	status=$(echo "$1" | head -n1 | cut -d ';' -f3)
	case "$status" in
		n)
			printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#317b9f"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="38.564">pending</text></svg>'
			;;
		r)
			printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#317b9f"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="37.886">running</text></svg>'
			;;
		0)
			printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#1c9867"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#000" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="38.374">success</text></svg>'
			;;
		*)
			printf '<svg width="111.87" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h58.874v20h-58.874z" fill="#292929"/><path d="m58.874 0h53v20h-53z" fill="#892b30"/><text x="29.437" y="13.003" fill="#ffffff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="44.244">toymaker</text><text x="85.374" y="13.003" fill="#fff" font-family="Iosevka, monospace" font-size="11px" text-anchor="middle" textLength="38.408">failure</text></svg>'
			;;
	esac
}
